package com.hgyc.mom.tool.strategy;

import com.hgyc.mom.tool.entity.AutoCodePart;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * 输入字符生成规则实现类
 * @author fwj
 * @since 2025/5/8
 */
@Component
@Order(0)
public class PartTypeInputCharHandler implements PartTypeTemplate {

    @Override
    public String partHandle(AutoCodePart autoCodePart) {
        String inputCharacter = autoCodePart.getInputCharacter();
        Assert.notNull(inputCharacter,"编码规则传入字符不能为空！");
//        Assert.isTrue(inputCharacter.length() == autoCodePart.getPartLength(),"传入字符的长度错误！");
        return inputCharacter;
    }

}
